<?php

/*
 * This script belongs to Aspect PHP.
 *
 * It is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or (at your
 * option) any later version.
 *
 * This script is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-
 * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
 * General Public License for more details.
 */

/**
 * The FooAspect class for testing AspectPHP
 *
 * @package    aspectPhp
 * @subpackage test
 * @author     gboisse
 */
class FooAspect {

    public function myBeforeAdvice(aspectJoinpoint $joinpoint) {

        $joinpoint->getMethodArgument('param')->addToTestingValue('BeforeAdvice');
    }

    public function myAfterAdvice(aspectJoinpoint $joinpoint) {

        if ($joinpoint->hasMethodArgument('param')) {
            $methodArguments = $joinpoint->getMethodArguments();
            $methodArguments['param']->addToTestingValue('AfterAdvice');
        }
    }

    public function myAroundAdvice(aspectJoinpoint $joinpoint, aspectAdviceChain $adviceChain) {

        $joinpoint->getMethodArgument('param')->addToTestingValue('Around');
    }

}
